package com.hua;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Set;

@SpringBootTest
@RunWith(SpringRunner.class)
public class ExerciseApplication1 {


    @Autowired
    private  RedisTemplate redisTemplate;

    @Test
    public void test(){
//        System.out.println(redisTemplate);
        ValueOperations valueOperations = redisTemplate.opsForValue();
        valueOperations.set("name","huisang");
        Set keys = redisTemplate.keys("*");
        System.out.println(valueOperations.get("name"));
        System.out.println(keys);
    }

}

